FIND_PACKAGE(WrapITK REQUIRED)

WRAP_LIBRARY("${PROJECT_NAME}")
  SET(WRAPPER_SWIG_LIBRARY_FILES ${WRAPPER_SWIG_LIBRARY_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/itkvtk.swg")
  SET(WRAPPER_LIBRARY_DEPENDS VXLNumerics Base SimpleFilters)
  SET(WRAPPER_LIBRARY_LINK_LIBRARIES ITKCommon ITKBasicFilters)

  IF(WRAP_ITK_PYTHON)
    # I can't manage to put that code in Python subdir :-(
    SET(VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
    SET(MIN_ITK_VER "5.0.0")
    IF("${VTK_VERSION}" STRLESS "${MIN_ITK_VER}")
      SET(WRAPPER_LIBRARY_LINK_LIBRARIES ${WRAPPER_LIBRARY_LINK_LIBRARIES} vtkImagingPython)
    ELSE("${VTK_VERSION}" STRLESS "${MIN_ITK_VER}")
      SET(WRAPPER_LIBRARY_LINK_LIBRARIES ${WRAPPER_LIBRARY_LINK_LIBRARIES} vtkImagingPythonD)
    ENDIF("${VTK_VERSION}" STRLESS "${MIN_ITK_VER}")
  
    SUBDIRS(Python)
  ELSE(WRAP_ITK_PYTHON)
    SET(WRAPPER_LIBRARY_LINK_LIBRARIES ITKCommon ITKBasicFilters vtkImaging vtkFiltering)
  ENDIF(WRAP_ITK_PYTHON)


  WRAPPER_LIBRARY_CREATE_WRAP_FILES()
END_WRAP_LIBRARY()


